package com.qiantu.phone.ui.activity;

import android.content.Intent;
import android.view.View;

import com.qiantu.phone.R;
import com.qiantu.phone.app.AppActivity;

public class SceneAddGuideActivity extends AppActivity {
        private View addScene;
        private View addAuto;

        @Override
        protected int getLayoutId() {
            return R.layout.activity_scene_add_guide;
        }

        @Override
        protected void initView() {
            int type = getInt("type");
            addScene = findViewById(R.id.add_scene);
            addAuto = findViewById(R.id.add_auto);
            setOnClickListener(addScene, addAuto);
            if(type == 1 || type == 2){
                addAuto.setVisibility(View.GONE);
            }
        }

        @Override
        protected void initData() {

        }

        @Override
        public void onClick(View view) {
            String roomSerialNo = getString("roomSerialNo");
            int type = getInt("type");
            if (view == addScene){
                Intent intent = new Intent(this, EditSceneActivityNew.class);
                if(type == 1){
                    intent.putExtra("type",3);
                }else if(type == 0){
                    intent.putExtra("type",1);
                }
                intent.putExtra("roomSerialNo",roomSerialNo);
                startActivity(intent);
            }else if (view == addAuto){
                Intent intent = new Intent(this, SelectFloorRoomActivity.class);
                intent.putExtra("selectType",1);
                intent.putExtra("title",getString(R.string.choose_room));
                intent.putExtra("roomSerialNo",roomSerialNo);
                startActivity(intent);
            }
        }
}
